package com.maidou.qiantai.controller;

import com.maidou.qiantai.api.OssServiceApi;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @Author maidou
 * @Date 2024/3/16 17:16
 *
 */
@RestController
@RequestMapping("/qiantai/api/oss")
public class ApiOssController
{

    @Resource
    private OssServiceApi ossServiceApi;

    @PostMapping("/up-image")
    public AjaxResult list(@RequestPart("file") MultipartFile multipartFile)
    {
        String url = ossServiceApi.OssUpload(multipartFile, null);
        return AjaxResult.success("成功",url);
    }
}
